const {ccclass, property} = cc._decorator;

@ccclass
export default class DialogBaseUI extends cc.Component {
    @property(cc.Node)
    bodyNode = null;
    @property(cc.Node)
    contentNode = null;
    @property(cc.Boolean)
    autoFix:boolean = true;
    onEnable(){
        if(this.autoFix) this.node.scaleX = cc.winSize.width/960;
        this.bodyNode.scale = 0;
        this.bodyNode.runAction(cc.scaleTo(0.35,1).easing(cc.easeBackOut()));
        if(this.contentNode){
            this.contentNode.runAction(cc.sequence(cc.hide(),cc.delayTime(0.35),cc.show()));
        }
    }

    onClickHide(){
        this.node.active = false;
    }
}
